type date in DXL

Hi all,
How can I get the period for last week for a script which is running in each Monday using current date?
For Monday, 13 Feb 2012 how could I get the dates of last week: Monday 6 Feb 2012 and Sunday 12 Feb 2012.

Thanks in advance,
Mar
Silvius - Thu Feb 09 07:43:00 EST 2012

Re: type date in DXL
Mathias Mamsch - Thu Feb 09 07:46:40 EST 2012

You convert to integer and then subtract a number of seconds, then convert back to date. Example:
 

Date dNow = today() 
// go back 7 days = 60*60*24*7 seconds
Date dOneWeekBefore = dateOf ( (intOf dNow) - 60*60*24*7 ) 
print "One week before it was: " stringOf (dOneWeekBefore, "ddd, dd.MM.yyyy")

 


Hope that helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS